/*
 * 
 *
 *
 */
package com.hboxs.asl.service;

import com.hboxs.asl.entity.Member;
import com.hboxs.asl.entity.Question;
import com.hboxs.asl.entity.YiYuanTrade;
import com.pingplusplus.model.Charge;

/**
 * Service - 支付查看答案
 */
public interface YiYuanTradeService extends BaseService<YiYuanTrade, Long> {

    /**
     * 处理支付
     *
     * @param charge ping++charge对象
     * @param yiYuanTrade  订单
     */
    void dealYiYuanTrade(Charge charge, YiYuanTrade yiYuanTrade);

    /**
     * 处理支付
     *
     * @param yiYuanTrade  订单
     */
    void dealYiYuanTrade(YiYuanTrade yiYuanTrade);

    /**
     * 根据订单编号查找
     * @param sn
     * @return
     */
    YiYuanTrade findBySn(String sn);

    /**
     * 生成订单
     * @param question
     * @param member
     * @return
     */
    String generateYiYuan(Question question, Member member);


    /**
     * 判断用户是否购买
     * @param member
     * @param questionId
     * @return
     */
    long isPay(Member member, Long questionId);

}
